package com.sk.weichat.ui.me;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.widget.FrameLayout;

import com.sk.weichat.R;
import com.sk.weichat.ui.base.BaseActivity;
import com.sk.weichat.view.pictureviewer.ImageDetailFragment;

/**
 * @author lzs
 * @date 2019/9/27
 * Email:343067508@qq.com
 **/
public class ImagePreviewActivity extends BaseActivity {

    private static final String key = "ImagePreviewActivity_key";

    public static final void startImagePreviewActivity(Context context, String url) {
        Intent intent = new Intent(context, ImagePreviewActivity.class);
        intent.putExtra(key, url);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_image_preview2);
        getSupportActionBar().hide();
        String url = getIntent() != null ? getIntent().getStringExtra(key) : "";
        if (!TextUtils.isEmpty(url)) {
            ImageDetailFragment imageDetailFragment = ImageDetailFragment.newInstance(url);
            getSupportFragmentManager().beginTransaction().replace(R.id.fl_content, imageDetailFragment).commit();
        }
    }
}
